﻿using StackExchange.Redis;
using System.Linq;

namespace ALEXBlog.Repository.Redis
{
    public class RedisConfigurationOprions
    {
        internal ConfigurationOptions configurationOptions = new ConfigurationOptions();

        /// <summary>
        /// 端号
        /// </summary>
        public string[] EndPoints
        {
            get => configurationOptions.EndPoints.Select(x => x.AddressFamily.ToString()).ToArray();
            set
            {
                foreach (var item in value)
                {
                    configurationOptions.EndPoints.Add(item);
                }
            }
        }

        /// <summary>
        /// 超时时间（默认180s）
        /// </summary>
        public int KeepAlive
        {
            get => configurationOptions.KeepAlive;
            set { configurationOptions.KeepAlive = value; }
        }

        /// <summary>
        /// 密码
        /// </summary>
        public string PassWord
        {
            get => configurationOptions.Password;
            set { configurationOptions.Password = value; }
        }

        /// <summary>
        /// 执行命令
        /// </summary>
        //public CommandMap CommandMap
        //{
        //    get => configurationOptions.CommandMap;
        //    set { configurationOptions.CommandMap = value; }
        //}


    }
}
